package coml.jiyun.hp.day02.presenter;

import java.util.ArrayList;
import coml.jiyun.hp.day02.bean.Bean;
import coml.jiyun.hp.day02.model.CollectionModel;
import coml.jiyun.hp.day02.net.ReslutCallBack;
import coml.jiyun.hp.day02.view.CollectionView;

public class CollectionPresenter {

    private CollectionView mView;
    private CollectionModel collectionModel;

    public CollectionPresenter(CollectionModel collectionModel) {
        this.collectionModel = collectionModel;
    }

    public CollectionPresenter(CollectionView mView) {
        this.mView = mView;
        this.collectionModel = collectionModel;
    }

    public void query(){
        collectionModel.query(new ReslutCallBack<ArrayList<Bean.ResultsBean>>() {
            @Override
            public void onSuccess(ArrayList<Bean.ResultsBean> resultsBeans) {
                mView.setData(resultsBeans);
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }
}
